@extends('layouts._app')
@section('content')
    <body>
    <div class="wrap-container">
        @include('layouts._flash')
        <input type="hidden">
        <div id="LAY-popup-user-add" class="layui-layer-content">
            <div class="layui-form" lay-filter="layuiadmin-form-label" style="padding: 20px 30px 0 0;">
                {!! Form::open(['route' => 'blog.link.store','class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'post']) !!}
                <div class="layui-form-item">
                    {!! Form::label('','* 名称：',['class'=>'layui-form-label','style'=>'color:red']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('name','',['required','lay-verify'=>'required','class'=>'layui-input','placeholder'=>'请输入名称']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','地址：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('url','',['class'=>'layui-input','placeholder'=>'请输入地址']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','图标：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <img title="友情链接图标" alt="友情链接图标" id="img_show"
                             style="display: none;"
                             src="{{asset('static/admin/icon/35508.png')}}">
                        <button type="button" style="display: none;float: right;"
                                class="layui-btn layui-btn-small layui-btn-danger delBtn">
                            <i class="layui-icon">&#xe640;</i>
                        </button>
                        <div class="layui-box layui-upload-button">
                            {!! Form::file('',['id'=>'file0','onchange'=>'previewImages(this,0)']) !!}
                            <span class="layui-upload-icon"><i class="layui-icon"></i>上传图片</span>
                        </div>
                    </div>
                    {!! Form::hidden('pic','',['id'=>'pic']) !!}
                </div>
                <br>
                <div class="layui-form-item">
                    {!! Form::label('','是否显示：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <input type="radio" name="is_show" value="1" title="是" checked>
                        <input type="radio" name="is_show" value="2" title="否">
                    </div>

                </div>
                <div class="layui-form-item">
                    {!! Form::label('','简介：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::textarea('content',"",['class'=>'layui-textarea','placeholder'=>'请输入简介']) !!}
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('确认',['class'=>'layui-btn','lay-filter'=>'formDemo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
        </div>
    </div>
    <script src="{{asset('static/admin/layui/layui.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/jquery.min.js')}}" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="{{asset('js/upload.js')}}"></script>
    <script>
        //Demo
        layui.use(['form', 'jquery'], function () {
            var form = layui.form();
            $ = layui.jquery;
            form.render();
            $('.delBtn').click(function () {
                $(this).attr('style', 'display:none');
                $("#pic").val('');
                var img = $("#img_show");
                img.attr('src', '{{asset('static/admin/icon/35508.png')}}');
                img.attr('style', 'display:none');
            })
        })
    </script>
    </body>
@endsection
